<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="WEB-INF/facelets/template.xhtml">
        <ui:param name="title" value="Välkommen till Vrångö IF Gym" />
        <ui:define name="content">
            
            <h:form id="login-form">
                
                <h:panelGroup>
                    <p:focus />
                    <h:panelGrid columns="3">
                        <h:outputLabel styleClass="login-labels" for="txt-username" value="Användarnamn"/>
                        <p:inputText 
                            id="txt-username"
                            value="#{Login.username}"
                            required="true"
                            styleClass="login-input inputText"/>
                        <h:message id="username-msg" for="txt-username" styleClass="error-msg" />
                    </h:panelGrid>
                    <h:panelGrid columns="3">
                        <h:outputLabel styleClass="login-labels" for="txt-password" value="Lösenord"/>
                        <p:password
                            feedback="false"
                            minLength="3"
                            id="txt-password"
                            value="#{Login.password}"
                            required="true"
                            styleClass="login-input inputText"/>
                        <h:message id="pwd-message" for="txt-password" styleClass="error-msg" />
                    </h:panelGrid>
                </h:panelGroup>
                
                <p:commandButton action="onLogin" actionListener="#{LoginCtrl.login}" value="Logga in" styleClass="commandButton"/><br />
                <a href="register.xhtml" id="register-link">Registrera dig</a>
            </h:form>

            <ui:include src="WEB-INF/includes/timetable.xhtml" />
            
        </ui:define>
    </ui:composition>
</html>
